package com.sskj.run.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonConverter;
import com.sskj.run.bean.BillRecordBean;
import com.sskj.run.ui.activity.BillindRecordActivity;

import java.util.List;

import io.reactivex.Flowable;

/**
 * Created by QinKang on 2018/12/28.
 */

public class BillindRecordPresenter extends BasePresenter<BillindRecordActivity> {

    /**
     * 账单流水
     */
    public Flowable<List<BillRecordBean>> getBillRecordList(String money_type, String start_time, String end_time, int page, int size) {
        return httpService.billRecordList(money_type,start_time,end_time,page, size)
                .converter(new JsonConverter<HttpData<PageBean<BillRecordBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getList());
    }
}
